<link href="/public/admin/css/goods.css" rel="stylesheet">
<script src="/public/common/ajaxfileupload.js"></script>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox-content">
                <div class="row">
                    <form action="<?=url('group.goods/create')?>" id="form-create" method="post" class="form-horizontal"
                          role="form">

                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">商品详情：</label>
                            <div style="margin-left: 10px;" class="col-sm-7">
                                <div class="row">
                                    <div style=" display: none;" class="photolist">
                                        <h2>图片资源管理器</h2>
                                        <img onclick="$('.photolist').hide(200);" class="closed" src="/public/admin/img/guanbi.png" />

                                        <div data-type="0" class="content jq_photolist">
                                            <div class="addimg">
                                                <img onclick="$('#file').click();" src="/public/admin/img/add_img.png"  />
                                                <input type="file" name="file" id="file" style="display:none;"/>
                                                <div style=" margin-top: 10px; text-align: center;font-size: 14px; ">添加新图片</div>
                                            </div>

                                        </div>
                                    </div>
                                    <div class="toutiaolt">
                                        <div  class="title">
                                            <h2>
                                                <a id="jq_title" href="javascript:void(0);">商品详情</a>
                                            </h2>
                                        </div>
                                        <div class="duanluo">
                                        </div>
                                        <div class="button">
                                            <button type="button" class="jq_dl_add btn btn-outline btn-default">新增段落</button>
                                            <!--<button mini="submit" for="toutiao_form" type="button" class="btn btn-outline btn-primary">发布文章</button>-->
                                            <button type="button" class="jq_yl_show btn btn-outline btn-info">预览</button>
                                        </div>
                                    </div>
                                    <div class="toutiaort">
                                        <div  id="jq_title_setting"  class="title_form">
                                            <div class="col-md-12">
                                                <div class="ibox-content">
                                                    <h2 style="margin-top: 80%" class="jq_dl_add">请添加先一个段落</h2>
                                                </div>
                                            </div>
                                        </div>
                                        <div style="display: none;" id="jq_yulang_setting" class="yulang">
                                        </div>
                                        <div  style="display: none;" id="jq_duanluo_setting"  class="title_form">
                                            <div class="col-md-12">
                                                <div class="ibox-content">
                                                    <h2> 段落管理 </h2>
                                                    <div class="alert alert-info">
                                                        段落如果有文章则添加文章，有图片则添加图片，不能两者同时为空！
                                                    </div>
                                                    <form role="form" class="form-horizontal m-t">
                                                        <div class="form-group">
                                                            <label class="col-sm-3 control-label">文字：</label>
                                                            <div class="col-sm-9">
                                                                <textarea rows="10" id="dlcontent" class="form-control"></textarea>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label class="col-sm-3 control-label">图片：</label>
                                                            <div class="col-sm-9">

                                                                <img width="150" height="150" id="dl_show_photo" src="/public/admin/img/add_img.png" />
                                                                <input type="hidden" name="dlphoto" id="dlphoto" />
                                                            </div>
                                                        </div>
                                                        <button type="button" id="jq_dlsetting"  class="btn btn-block btn-outline btn-primary">确定设置</button>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix form-actions">
                            <div class="col-md-offset-3 col-md-9">
                                <button mini="submit" for="form-create" class="btn btn-info" type="button">
                                    <i class="ace-icon fa fa-check bigger-110"></i>
                                    保存
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script id="imgitemtpl" type="text/html">
    <div class="imgitem">
        <img src="/attachs/uploads/{{d.img}}"  />
        <div class="action">
            <button type="button" data-photo="{{d.img}}"  class="jq_yes_imgitem btn btn-outline btn-primary">选择</button>
            <button type="button"  class="jq_delete_imgitem btn btn-outline btn-danger">删除</button>
        </div>
    </div>
</script>
<script id="yltpl" type="text/html">
    <div class="title">
        <a  href="javascript:void(0);">详情页预览</a>
    </div>
    <div class="content">
        {{# for(var i = 0, len = d.contentdata.length; i < len; i++){ }}
        <div  class="dl">
            {{# if(d.contentdata[i].pic){ }}
            <img src="/attachs/uploads/{{d.contentdata[i].pic}}"/>
            {{# } }}
            {{# if(d.contentdata[i].content){ }}
            {{d.contentdata[i].content}}
            {{# } }}
        </div>
        {{# } }}
    </div>
</script>
<script id="dlitemtpl" type="text/html">
    <div  class="item">
        <a  href="javascript:void(0);" class="jq_delete_dl"><img width="30" height="30" src="/public/admin/img/delete.png" /></a>
        <div class="jq_item" data-id="{{d.id}}" style="width: 100%;height: 100%;">
            <div class="lt">
                <img id="dl_show_pic_{{d.id}}" width="80" height="80" src="/public/admin/img/wenben.png" />
            </div>
            <div id="dl_show_content_{{d.id}}" class="rt">

            </div>
            <input type="hidden" name="dl[{{d.id}}][photo]" id="dl_photo_{{d.id}}"/>
            <input type="hidden" name="dl[{{d.id}}][content]" id="dl_content_{{d.id}}"/>
        </div>
    </div>
</script>
<script>
    var day = '<?=date("Y-m-d",time());?>';
    var imgurl = '<?php echo IMG_URL;?>';
    var uploadUrl = '<?=url("upload.upload/index",["mdl"=>"toutiao_photo"])?>';
</script>
<script src="/public/admin/js/goods.js"></script>
